package Interfaz;

import javax.swing.JFrame;
import javax.swing.WindowConstants;

import Gestores.GestorDeUsuario;

import java.awt.CardLayout;
import java.awt.Component;

public class Aplicacion extends JFrame {
	
	private PantallaLogin pL;
	private PantallaPrincipal pP;
	
	private GestorDeUsuario gdp;
	
	public Aplicacion() {
		gdp = new GestorDeUsuario();
		
		setResizable(false);
		setBounds(100,50,1085,619);
		getContentPane().setLayout(new CardLayout(0, 0));
		
		pL = new PantallaLogin(this);
		getContentPane().add(pL,"pantallaLogin");
		

		pP = new PantallaPrincipal(this,gdp);
		getContentPane().add(pP,"pantallaPrincipal");
		
		this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
		
	}

	public void cambiarPantalla(String nombrePantalla){
		CardLayout cardMaster = (CardLayout)getContentPane().getLayout();
		cardMaster.show(this.getContentPane(), nombrePantalla);
	}

	public GestorDeUsuario getGestorDePersona(){
		return gdp;
	}


}
